#ifndef SPHERE_H
#define SPHERE_H

#include "Game Engine/Header/d3dUtil.h"
#include "Game Engine/Header/Vertex.h"

class Sphere
{
public:
	Sphere();
	~Sphere();

	void init( ID3D10Device* device, float radius, UINT numSlices, UINT numStacks,
		bool isEllipsoid = false, float xRadius = 1.0f, float yRadius = 1.0f, float zRadius = 1.0f );
	void draw();

	std::vector<Vertex> GetVertices();
	std::vector<DWORD> GetIndices();

	DWORD mNumVertices;
	DWORD mNumFaces;

private:
	typedef std::vector<Vertex> VertexList;
	typedef std::vector<DWORD> IndexList;

	void buildStacks( VertexList& vertices, IndexList& indices );

private:
	float mRadius;
	float mXRadius;
	float mYRadius;
	float mZRadius;
	bool  mIsEllipsoid;
	UINT  mNumSlices;
	UINT  mNumStacks;

 	std::vector<Vertex> mVertices;
	std::vector<DWORD> mIndices;

	ID3D10Device* md3dDevice;
	ID3D10Buffer* mVB;
	ID3D10Buffer* mIB;
};

#endif // SPHERE_H